// ============================== 导入依赖 ============================== //

import CORE from '@/CORE'
import Client from '@api/base/api/DashboardTeamApi'

import ComClass from '@api/ComQuery'
import TeamVideoListQueryReq from '@api/base/model/TeamVideoListQueryReq'
import TeamSpecialPieReq from '@api/base/model/TeamSpecialPieReq'
import TeamEnergyPieReq from '@api/base/model/TeamEnergyPieReq'
import TeamEnvironmentPieReq from '@api/base/model/TeamEnvironmentPieReq'
import TeamDevicePieReq from '@api/base/model/TeamDevicePieReq'
import TeamPersonPieReq from '@api/base/model/TeamPersonPieReq'
import TeamAlarmListReq from '@api/base/model/TeamAlarmListReq'
import TeamPlanListReq from '@api/base/model/TeamPlanListReq'
import TeamWorkOrderListReq from '@api/base/model/TeamWorkOrderListReq'

const CLIENT = CORE.grpcCLIENT(Client)

// ============================== 导出远程接口 ============================== //

export default {
  async queryTeamVideoList(param = {
    /**
     * 班组ID
     */
    teamId: '',
    /**
     * 租户分区标识
     */
    tenantNo: 0,
  }, TIP = '查询班组视频监控列表') {
    const req = CORE.grpcDTO(TeamVideoListQueryReq, param)
    const res = await CORE.grpc(TIP, CLIENT, 'queryTeamVideoList', req)
    return res
  },

  async queryTeamSpecialPie(param = {
    /**
     * 班组ID
     */
    teamId: '',
    /**
     * 租户分区标识
     */
    tenantNo: 0,
  }, TIP = '查询班组对应特色统计——蒸汽统计') {
    const req = CORE.grpcDTO(TeamSpecialPieReq, param)
    const res = await CORE.grpc(TIP, CLIENT, 'queryTeamSpecialPie', req)
    return res
  },

  async queryTeamEnergyPie(param = {
    /**
     * 班组ID
     */
    teamId: '',
    /**
     * 租户分区标识
     */
    tenantNo: 0,
  }, TIP = '用量统计（今日）') {
    const req = CORE.grpcDTO(TeamEnergyPieReq, param)
    const res = await CORE.grpc(TIP, CLIENT, 'queryTeamEnergyPie', req)
    return res
  },

  async queryTeamEnvironmentPie(param = {
    /**
     * 班组ID
     */
    teamId: '',
    /**
     * 租户分区标识
     */
    tenantNo: 0,
  }, TIP = '环境状态') {
    const req = CORE.grpcDTO(TeamEnvironmentPieReq, param)
    const res = await CORE.grpc(TIP, CLIENT, 'queryTeamEnvironmentPie', req)
    return res
  },

  async queryTeamDevicePie(param = {
    /**
     * 班组ID
     */
    teamId: '',
    /**
     * 租户分区标识
     */
    tenantNo: 0,
  }, TIP = '设备运行状态') {
    const req = CORE.grpcDTO(TeamDevicePieReq, param)
    const res = await CORE.grpc(TIP, CLIENT, 'queryTeamDevicePie', req)
    return res
  },

  async queryTeamPersonPie(param = {
    /**
     * 班组ID
     */
    teamId: '',
    /**
     * 租户分区标识
     */
    tenantNo: 0,
  }, TIP = '人员信息') {
    const req = CORE.grpcDTO(TeamPersonPieReq, param)
    const res = await CORE.grpc(TIP, CLIENT, 'queryTeamPersonPie', req)
    return res
  },

  async queryTeamAlarmList(param = {
    /**
     * 类型
     * -1 全部
     * -2 统计
     * -3 普通分页
     */
    type: 1,
    /**
     * 当前页
     */
    page: 1,
    /**
     * 每页记录数
     */
    pageSize: 10,
    /**
     * 租户分区标识
     */
    tenantNo: 0,
    /**
     * 班组ID
     */
    teamId: '',
  }, TIP = `${CORE.MAP.ALARM}信息`) {
    const req = CORE.grpcDTO(TeamAlarmListReq, param, [ComClass, 'comQuery'])
    const res = await CORE.grpc(TIP, CLIENT, 'queryTeamAlarmList', req)
    return res
  },

  async queryTeamPlanList(param = {
    /**
     * 类型
     * -1 全部
     * -2 统计
     * -3 普通分页
     */
    type: 1,
    /**
     * 当前页
     */
    page: 1,
    /**
     * 每页记录数
     */
    pageSize: 10,
    /**
     * 租户分区标识
     */
    tenantNo: 0,
    /**
     * 班组ID
     */
    teamId: '',
  }, TIP = '巡检保养（今日）') {
    const req = CORE.grpcDTO(TeamPlanListReq, param, [ComClass, 'comQuery'])
    const res = await CORE.grpc(TIP, CLIENT, 'queryTeamPlanList', req)
    return res
  },

  async queryTeamWorkOrderList(param = {
    /**
     * 类型
     * -1 全部
     * -2 统计
     * -3 普通分页
     */
    type: 1,
    /**
     * 当前页
     */
    page: 1,
    /**
     * 每页记录数
     */
    pageSize: 10,
    /**
     * 租户分区标识
     */
    tenantNo: 0,
    /**
     * 班组ID
     */
    teamId: '',
  }, TIP = '工单信息') {
    const req = CORE.grpcDTO(TeamWorkOrderListReq, param, [ComClass, 'comQuery'])
    const res = await CORE.grpc(TIP, CLIENT, 'queryTeamWorkOrderList', req)
    return res
  },
}
